Skip to content

Conversation

@gursewak1997
Copy link
Member

We want to complete all other actions before fully pruning a build and deleting the S3 directory. This guarantees the meta.json file remains accessible if needed.

case "build":
prune_build(s3_client, bucket, prefix, build_id, args.dry_run)
pruned_build_ids.append(build_id)
builds_to_prune.append(build_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
builds_to_prune.append(build_id)
# Since pruning a build prunes s3 for all architectures
# we'll prune later so that we do it only once and we
# make sure we've completed any architecture specific
# operations, (i.e. pruning aarch64 AMIs).
builds_to_prune.append(build_id)

# Original list of builds
builds = builds_json_data["builds"]
pruned_build_ids = []
builds_to_prune = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should make this a set so we can't add an entry more than once, which is what I think the below code will be doing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True that, updating.

We wanna make every other action is run before we prune a build fully
and delete the s3 dir. It makes sure the meta.json is still available
if needed.
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gursewak1997 gursewak1997 enabled auto-merge (rebase) December 11, 2024 23:34
@gursewak1997 gursewak1997 merged commit 17c1cc8 into coreos:main Dec 11, 2024
5 checks passed
@gursewak1997 gursewak1997 deleted the fix-builds-pruning-step branch December 12, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants